document.write(" <link rel=stylesheet href='../js/loding/loding.css'>");
document.write("<script language=javascript src='../js/loding/loading.js'></script>");
var  imglist;


function saveimg(obj,txt,index) {
    showLoading("正在上传图片中....","div");
    var formData = new FormData();
    console.log(obj);
    formData.append('file', obj);  //添加图片信息的参数
    $.ajax({
        url: '/Upload/multiUpload',
        type: 'POST',
        cache: false, //上传文件不需要缓存
        data: formData,
        processData: false, // 告诉jQuery不要去处理发送的数据
        contentType: false, // 告诉jQuery不要去设置Content-Type请求头
        success: function (data) {
            if (data.code) {
                if (imglist != "" && imglist != null && imglist != undefined)
                {
                    var arr = imglist.split(',');
                    if (arr.length >= index + 1) {
                        arr.splice(index, 1, data.object);
                        imglist = arr.join(",");
                }
                }
                    if (imglist == "" || imglist == null || imglist == undefined) {
                        imglist = data.object;
                    } else {
                        imglist = imglist + "," + data.object;
                    }

                hideLoading();//隐藏后的回调函数
                mui.toast(data.msg);
                console.log(imglist);
            }
            else {
                hideLoading();//隐藏后的回调函数
                mui.toast(data.msg);
            }
        }
    })
    hideLoading();//隐藏后的回调函数
}